using System.Web.Security;
using Impact.Infrastructure.Membership;

namespace Impact.Web.Foundation.MembershipProviders
{
    /// <summary>
    /// instantiation of the IMembershipService that uses the ASP.NET Membership provider
    /// </summary>
    [StructureMap.Pluggable("AspNetMembershipService")]
    public class AspNetMembershipService : IMembershipService
    {
        #region IMembershipService Members

        /// <summary>
        /// Creates a new user with the given properties
        /// </summary>
        /// <returns>true if creation was successful</returns>
        public bool CreateUser(string username, string password, string email)
        {
            MembershipUser newUser = Membership.CreateUser(username, password, email);
            return newUser != null;
        }

        #endregion
    }
}
